unit Form_Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TFormMain = class(TForm)
    Btn_Install: TButton;
    Btn_UnInstall: TButton;
    Button1: TButton;
    Button2: TButton;
    GroupBox1: TGroupBox;
    Button3: TButton;
    Label1: TLabel;
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    procedure ExecAutoRun(AValue:Boolean);
    procedure RegAutoRun;
  public
    procedure InstallAutoRun;
    procedure UnInstallAutoRun;

    procedure ExecForbidCursor;
  end;

var
  FormMain: TFormMain;

implementation

uses
  Registry,Utilib_Hook;

{$R *.dfm}

procedure TFormMain.ExecAutoRun(AValue: Boolean);
var
  AReg:TRegistry;
begin
  AReg:=TRegistry.create; 
  AReg.rootkey:=HKEY_LOCAL_MACHINE; 
  AReg.openkey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run',true); 
  AReg.WriteString('DeskManage',Application.ExeName);
  AReg.closekey;
  AReg.free;
end;

procedure TFormMain.InstallAutoRun;
begin

end;

procedure TFormMain.RegAutoRun;

begin
  //
end;

procedure TFormMain.UnInstallAutoRun;
begin

end;

procedure TFormMain.ExecForbidCursor;
var
  ARect:TRect;
begin
  {ARect:=Self.ClientRect;
  ARect.TopLeft:=Self.ClientToScreen(ARect.TopLeft);
  ARect.BottomRight:=Self.ClientToScreen(ARect.BottomRight);   }
  ARect.Left:=10;
  ARect.Top:=10;
  ARect.Right:=10;
  ARect.Bottom:=10;
  
  ClipCursor(@ARect);
end;

procedure TFormMain.Button2Click(Sender: TObject);
begin
  Utilib_Hook.StartHookKeyMouse;
end;

procedure TFormMain.Button3Click(Sender: TObject);
begin
  Utilib_Hook.StartHookKeyMouse;
end;

end.
